#include "QPubApi.h"

#include <QLabel>
#include <QHBoxLayout>
#include <QLineEdit>
#include <QComboBox>

QLineEdit* QPubApi::createLineEditComb(QString lab, QString lab2, QHBoxLayout*& hLyt)
{
	hLyt = new QHBoxLayout();
	QLabel* label = new QLabel(lab);
	QLineEdit* lineEdit = new QLineEdit();
	hLyt->addWidget(label);
	hLyt->addWidget(lineEdit);
	if (!lab2.isEmpty())
	{
		QLabel* label2 = new QLabel(lab2);
		hLyt->addWidget(label2);
	}
	return lineEdit;
}

QComboBox* QPubApi::createlineComboxComb(QString lab, QStringList comboxItems, QHBoxLayout*& hLyt, QWidget* parent)
{
	QLabel* label = new QLabel(lab);
	QComboBox* combox = new QComboBox(parent);
	if (!comboxItems.isEmpty())
	{
		combox->addItems(comboxItems);
	}

	hLyt = new QHBoxLayout();
	hLyt->addWidget(label);
	hLyt->addWidget(combox);

	return combox;
}
